﻿@model mvcForum.Web.ViewModels.TopicViewModel
@using CreativeMinds.MVC.Common.Helpers;
@using mvcForum.Web.Extensions;
@using mvcForum.Web.Helpers;
@{
	var iconName = String.Empty;
	if (Model.Sticky) {
		iconName += "sticky";
	}
	else if (Model.Announcement) {
		iconName += "announcement";
	}
	else {
		iconName += "topic";
	}
	if (Model.HasUnread) {
		iconName += "_unread";
	}
	else {
		iconName += "_read";
	}
	if (Model.Locked) {
		iconName += "_locked";
	}
	iconName += ".gif";
}
		<li class="row bg1">
			<dl class="icon" style="background-image: url(@Url.ForumImage(iconName)); background-repeat: no-repeat;">
				<dt title="*">@Html.TopicLink(Model.Id, Model.Title, new { @class = "topictitle" })<br />
				<!--<strong class="pagination"><span><a href="./viewtopic.php?style=250&amp;f=14&amp;t=43">1</a> ... <a href="./viewtopic.php?style=250&amp;f=14&amp;t=43&amp;start=40">5</a><span class="page-sep">, </span><a href="./viewtopic.php?style=250&amp;f=14&amp;t=43&amp;start=50">6</a><span class="page-sep">, </span><a href="./viewtopic.php?style=250&amp;f=14&amp;t=43&amp;start=60">7</a></span></strong>
				-->
				@if (Model.Pages > 1) {
				<strong class="pagination"><span>@for (int index = 1; index <= Model.Pages; index++) { if (index > 1) { <span class="page-sep">, </span> } Html.RouteLink(index.ToString(), "ShowTopic", new RouteValueDictionary { { "id", Model.Id }, { "title", Url.URLFriendlyString(Model.Title) }, { "page", index } }); }</span></strong>}
					@ForumHelper.GetString("Topic.LastPost", new object[] { Model.Author, Model.Posted.ToLocalDateTime() }) </dt>
				<dd class="posts">@ForumHelper.GetHtmlString("Topic.Replies", new object[] { Model.MessageCount })</dd>
				<dd class="views">@ForumHelper.GetHtmlString("Topic.Views", new object[] { Model.Views })</dd>
				<dd class="lastpost">@Html.Partial("LastMessagePartial", Model)</dd>
			</dl>
		</li>
